package com.mission.schedule.adapter;

import android.content.Context;
import android.os.Handler;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.mission.schedule.R;
import com.mission.schedule.activity.NewFriendsActivity;
import com.mission.schedule.adapter.utils.CommonAdapter;
import com.mission.schedule.adapter.utils.ViewHolder;
import com.mission.schedule.bean.NoteTypeBean;
import com.mission.schedule.bean.qd606.NoteTitleDetailBean;

import java.util.List;

public class NoteTypePXAdapter extends CommonAdapter<NoteTypeBean.ListBean>{

	public List<NoteTypeBean.ListBean> mlList;
	private Handler handler;

	public NoteTypePXAdapter(Context context, List<NoteTypeBean.ListBean> lDatas, Handler handler,
							  int layoutItemID) {
		super(context, lDatas, layoutItemID);
		this.mlList = lDatas;
		this.handler = handler;
	}
	public void updateTypeName(String name,int position){
		mlList.get(position).setContent(name);
		notifyDataSetChanged();
	}

	@Override
	public void getViewItem(ViewHolder holder, NoteTypeBean.ListBean item, int position) {
		TextView content_tv = (TextView) holder.getView(R.id.content_tv);
		RelativeLayout tuodong_rl = (RelativeLayout) holder.getView(R.id.tuodong_rl);
		content_tv.setText(item.content);
	}

	public void remove(NoteTypeBean.ListBean item) {
		if (item != null && mlList != null) {
			mlList.remove(item);
		}
	}

	public void insert(NoteTypeBean.ListBean item, int to) {
		if (item != null) {
			mlList.add(to, item);
		}
	}
}
